<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
					xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
					xmlns:controls="clr-namespace:Rhiannon.Windows.Controls"
					xmlns:converters="clr-namespace:Rhiannon.Windows.Presentation.Converters"
					xmlns:presentation="clr-namespace:Rhiannon.Windows.Presentation"
					xmlns:system="clr-namespace:System;assembly=mscorlib">
	<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />

	<Style TargetType="{x:Type presentation:UserControlView}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type presentation:UserControlView}">
					<Grid Background="{TemplateBinding Background}">
						<ContentPresenter />
						<Grid Visibility="{Binding Path=IsBusy, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}">
							<Border Background="White" Opacity="0.5" />
							<TextBlock Text="Loading..." HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" />
						</Grid>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style TargetType="{x:Type controls:BrowseDirectory}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type controls:BrowseDirectory}">
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="*" />
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>
						<Border Grid.ColumnSpan="3"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}">
						</Border>
						<TextBox Grid.Column="0" Text="{Binding Path=Path, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" />
						<Button x:Name="BROWSE_BUTTON_PART" Grid.Column="1" Content="Browse" VerticalAlignment="Center" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style TargetType="{x:Type controls:BrowseFile}">
		<Setter Property="Margin" Value="0" />
		<Setter Property="Padding" Value="0" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type controls:BrowseFile}">
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="*" />
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>
						<TextBox Grid.Column="0"
								 Text="{Binding Path=Path, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}"/>
						<Button x:Name="BROWSE_BUTTON_PART" Grid.Column="1" Content="Browse" Margin="0" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style TargetType="{x:Type controls:TileButton}">
		<Setter Property="Height" Value="105" />
		<Setter Property="Width" Value="140" />
		<Setter Property="Margin" Value="10" />
		<Setter Property="Cursor" Value="Hand" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type controls:TileButton}">
					<Border Name="Border" Background="{TemplateBinding Background}" >
						<Border Background="{TemplateBinding Background}">
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto" />
									<RowDefinition Height="*" />
								</Grid.RowDefinitions>
								<controls:BlurlessImage Grid.Row="0" Source="{TemplateBinding Icon}" Height="64" Width="64" />
								<TextBlock Grid.Row="1" Text="{TemplateBinding Text}" HorizontalAlignment="Center" VerticalAlignment="Top" TextAlignment="Center"
										   Foreground="{TemplateBinding Foreground}" TextTrimming="WordEllipsis" Margin="3,0,3,3" TextWrapping="Wrap" />
							</Grid>
						</Border>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter Property="Opacity" Value="0.7" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<FontFamily x:Key="HeaderFontFamily">Segoe</FontFamily>
	<FontWeight x:Key="HeaderFontWeight">Normal</FontWeight>
	<system:Double x:Key="HeaderFontSize">14</system:Double>

	<FontFamily x:Key="ContentFontFamily">Segoe</FontFamily>
	<FontWeight x:Key="ContentFontWeight">Normal</FontWeight>
	<system:Double x:Key="ContentFontSize">14</system:Double>

	<SolidColorBrush x:Key="CustomWindowColor">#03AFEF</SolidColorBrush>
	<!--#31B6FD-->

	<Style x:Key="CustomWindowControlButtonStyle" TargetType="{x:Type Button}">
		<Setter Property="VerticalAlignment" Value="Top" />
		<Setter Property="SnapsToDevicePixels" Value="True" />
		<Setter Property="Focusable" Value="false" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Button}">
					<Border Name="Border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="Transparent"
							Background="Transparent" Margin="0" Padding="0" Width="32" Height="32" HorizontalAlignment="Center" VerticalAlignment="Stretch">
						<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="Border" Property="Background" Value="#CDE6F7" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="ResizeAreaRectangleStyle" TargetType="{x:Type Rectangle}">
		<Setter Property="Stroke" Value="{x:Null}"/>
		<Setter Property="Fill" Value="Transparent"/>
		<Setter Property="VerticalAlignment" Value="Stretch"/>
		<Setter Property="HorizontalAlignment" Value="Stretch"/>
		<Style.Triggers>
			<Trigger Property="IsMouseOver" Value="true">
				<Setter Property="Fill" Value="{StaticResource CustomWindowColor}"/>
				<Setter Property="Opacity" Value="0.2"/>
			</Trigger>
		</Style.Triggers>
	</Style>


	<Style TargetType="{x:Type controls:CustomWindow}">
		<Setter Property="WindowStyle" Value="None"/>
		<Setter Property="ResizeMode" Value="NoResize"/>
		<Setter Property="AllowsTransparency" Value="True" />
		<Setter Property="Margin" Value="2" />
		<Setter Property="TitleHeight" Value="34" />
		<Setter Property="SnapsToDevicePixels" Value="True" />
		<Setter Property="Padding" Value="0" />
		<Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
		<Setter Property="FontWeight" Value="{StaticResource ContentFontWeight}" />
		<Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type controls:CustomWindow}">
					<Border Name="WindowBorder">
						<Grid>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto" />
								<RowDefinition Height="*" />
								<RowDefinition Height="Auto" />
							</Grid.RowDefinitions>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="*" />
								<ColumnDefinition Width="Auto" />
							</Grid.ColumnDefinitions>
							<Border Grid.Row="1" Grid.Column="1" BorderBrush="{StaticResource CustomWindowColor}" BorderThickness="1" Background="#FFFFFF">
								<Border.Effect>
									<DropShadowEffect Color="#000000" BlurRadius="7" ShadowDepth="0" RenderingBias="Performance" Opacity="0.6" />
								</Border.Effect>
								<Grid>
									<Grid.RowDefinitions>
										<RowDefinition Height="Auto"/>
										<RowDefinition Height="*"/>
										<RowDefinition Height="Auto"/>
									</Grid.RowDefinitions>
									<Border Grid.Row="0" Name="HeaderBorder" TextBlock.FontFamily="{StaticResource HeaderFontFamily}" Height="{TemplateBinding TitleHeight}" VerticalAlignment="Top"
											TextBlock.FontWeight="{StaticResource HeaderFontWeight}" TextBlock.FontSize="{StaticResource HeaderFontSize}">
										<Grid>
											<Grid.ColumnDefinitions>
												<ColumnDefinition Width="Auto" />
												<ColumnDefinition Width="*" />
												<ColumnDefinition Width="Auto" />
												<ColumnDefinition Width="Auto" />
												<ColumnDefinition Width="Auto" />
											</Grid.ColumnDefinitions>
											<Border Grid.ColumnSpan="5" Background="#31B6FD" />
											<controls:BlurlessImage Grid.Column="0" Source="{TemplateBinding AdditionalIcon}" VerticalAlignment="Center"/>
											<TextBlock Grid.Column="1" Text="{TemplateBinding Title}" VerticalAlignment="Center" Foreground="#FFFFFF" />
											<Button Grid.Column="2" Style="{StaticResource CustomWindowControlButtonStyle}" Name="MinimizeButton">
												<controls:BlurlessImage Source="pack://application:,,,/Rhiannon.Windows;component/Controls/Images/CustomWindow/Minimize.png" />
											</Button>
											<Button Grid.Column="3" Style="{StaticResource CustomWindowControlButtonStyle}" Name="RestoreButton">
												<controls:BlurlessImage Source="pack://application:,,,/Rhiannon.Windows;component/Controls/Images/CustomWindow/Restore.png" />
											</Button>
											<Button Grid.Column="3" Style="{StaticResource CustomWindowControlButtonStyle}" Name="MaximizeButton">
												<controls:BlurlessImage Source="pack://application:,,,/Rhiannon.Windows;component/Controls/Images/CustomWindow/Maximize.png" />
											</Button>
											<Button Grid.Column="4" Style="{StaticResource CustomWindowControlButtonStyle}" Name="CloseButton">
												<controls:BlurlessImage Source="pack://application:,,,/Rhiannon.Windows;component/Controls/Images/CustomWindow/Close.png" />
											</Button>
										</Grid>
									</Border>
									<ContentPresenter Grid.Row="1" TextBlock.FontFamily="{StaticResource ContentFontFamily}" 
													  TextBlock.FontWeight="{StaticResource ContentFontWeight}" TextBlock.FontSize="{StaticResource ContentFontSize}" />
									<!--<Border Grid.Row="2" Background="#31B6FD" Height="23">
										
									</Border>-->
								</Grid>
							</Border>
							<Rectangle Grid.Row="0" Grid.Column="0" x:Name="TopLeftResizeShape" Style="{StaticResource ResizeAreaRectangleStyle}" Margin="3,3,-3,-3" Tag="{x:Static controls:ResizeDirection.TopLeft}"
									   Height="{TemplateBinding WindowResizeAreaSize}" Width="{TemplateBinding WindowResizeAreaSize}" Cursor="SizeNWSE" />
							<Rectangle Grid.Row="0" Grid.Column="1" x:Name="TopCenterResizeShape" Style="{StaticResource ResizeAreaRectangleStyle}" Margin="0,3,0,-3" Tag="{x:Static controls:ResizeDirection.Top}"
									   Height="{TemplateBinding WindowResizeAreaSize}" Cursor="SizeNS" />
							<Rectangle Grid.Row="0" Grid.Column="2" x:Name="TopRightResizeShape" Style="{StaticResource ResizeAreaRectangleStyle}" Margin="-3,3,3,-3" Tag="{x:Static controls:ResizeDirection.TopRight}"
									   Height="{TemplateBinding WindowResizeAreaSize}" Width="{TemplateBinding WindowResizeAreaSize}" Cursor="SizeNESW" />
							<Rectangle Grid.Row="1" Grid.Column="0" x:Name="CenterLeftResizeShape" Style="{StaticResource ResizeAreaRectangleStyle}" Margin="3,0,-3,0" Tag="{x:Static controls:ResizeDirection.Left}"
									   Width="{TemplateBinding WindowResizeAreaSize}" Cursor="SizeWE" />
							<Rectangle Grid.Row="1" Grid.Column="2" x:Name="CenterRightResizeShape" Style="{StaticResource ResizeAreaRectangleStyle}" Margin="-3,0,3,0" Tag="{x:Static controls:ResizeDirection.Right}"
									   Width="{TemplateBinding WindowResizeAreaSize}" Cursor="SizeWE" />
							<Rectangle Grid.Row="2" Grid.Column="0" x:Name="BottomLeftResizeShape" Style="{StaticResource ResizeAreaRectangleStyle}" Margin="3,-3,-3,3" Tag="{x:Static controls:ResizeDirection.BottomLeft}" 
									   Height="{TemplateBinding WindowResizeAreaSize}" Width="{TemplateBinding WindowResizeAreaSize}" Cursor="SizeNESW" />
							<Rectangle Grid.Row="2" Grid.Column="1" x:Name="BottomCenterResizeShape" Style="{StaticResource ResizeAreaRectangleStyle}" Margin="0,-3,0,3" Tag="{x:Static controls:ResizeDirection.Bottom}"
									   Height="{TemplateBinding WindowResizeAreaSize}" Cursor="SizeNS" />
							<Rectangle Grid.Row="2" Grid.Column="2" x:Name="BottomRightResizeShape" Style="{StaticResource ResizeAreaRectangleStyle}" Margin="-3,-3,3,3" Tag="{x:Static controls:ResizeDirection.BottomRight}"
									   Height="{TemplateBinding WindowResizeAreaSize}" Width="{TemplateBinding WindowResizeAreaSize}" Cursor="SizeNWSE" />
						</Grid>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>


    <Style x:Key="{x:Type controls:ImageButton}" TargetType="{x:Type controls:ImageButton}">
        <Setter Property="Foreground" Value="#000000" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:ImageButton}">
                    <Border Name="Border">
                        <Image x:Name="Image" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="#CDE6F7" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Opacity" Value="0.5" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
